package com.dc.designPattern._10_flyweight.impl;

/**
 * Description: 享元模式_客户端
 * @author: gdc
 * @date: 2021/4/12
 * @version 1.0
 */
public class Client {

    public static void main(String[] args){
        WebSiteFactory factory = new WebSiteFactory();

        WebSite webSite1 = factory.getWebSite("新闻");
        webSite1.use(new User("杨过"));

        WebSite webSite2 = factory.getWebSite("博客");
        webSite2.use(new User("小龙女"));

        WebSite webSite3 = factory.getWebSite("博客");
        webSite3.use(new User("令狐冲"));

        WebSite webSite4 = factory.getWebSite("博客");
        webSite4.use(new User("风清扬"));

        System.out.println("网站总分类为：" + factory.getWebSiteCount());
    }
}
